<?php
namespace app\api\controller\v2;
use \think\Db;

class AstroSetting
{
    public $charts = ['now','natal','transits', 'thirdprogressed','thirdprogressedvsnatal', 'progressions','progressionsvsnatal', 'solar', 'firdaria', 'profection', 'synastry', 'composite', 'composite_thirdprogressed', 'composite_progressions', 'davison', 'solar_return', 'lunar_return' , 'marks','divination'];
    public $setting1 = [
        'now'=>[
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'natal'=>[
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100100001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'transits'=>[
            'asp_orb_all'=> [0=>2,60=>1,90=>2,120=>2,180=>2,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
            'style'=>'cn',
            'firdaria'=>'default',
        ],
        'thirdprogressed'=>[
            //            'asp_orb_all'=> [0=>3,60=>2,90=>3,120=>3,180=>3,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'thirdprogressedvsnatal'=>[
            'asp_orb_all'=> [0=>2,60=>1,90=>2,120=>2,180=>2,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
            'style'=>'cn',
            'firdaria'=>'default',
        ],
        'progressions'=>[
            //            'asp_orb_all'=> [0=>2,60=>2,90=>2,120=>2,180=>2,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'progressionsvsnatal'=>[
            'asp_orb_all'=> [0=>2,60=>1,90=>2,120=>2,180=>2,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
            'style'=>'cn',
            'firdaria'=>'default',
        ],
        'solar'=>[
            'asp_orb_all'=> [0=>1,60=>0,90=>1,120=>0,180=>1,30=>0,150=>1,45=>1,135=>1,72=>0,144=>0],
            'asps_display'=>[0,45,90,135,180],
            'planets_display'=>'111111111100100001111',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'solar_return'=>[
            //            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100100001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'lunar_return'=>[
            //            'asp_orb_all'=> [0=>4,60=>2,90=>3,120=>3,180=>3.5,30=>0.5,150=>1,45=>1,135=>1,72=>0.5,144=>0.5],
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100100001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'firdaria'=>[
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100100001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
            'firdaria'=>'default',
        ],
        'profection'=>[
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100100001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'synastry'=>[
            'asp_orb_all'=> [0=>6,60=>4,90=>6,120=>6,180=>6,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100100001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'composite'=>[
            //            'asp_orb_all'=> [0=>4,60=>3,90=>4,120=>4,180=>4,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'composite_thirdprogressed'=>[
            //            'asp_orb_all'=> [0=>5,60=>4,90=>5,120=>5,180=>5,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'composite_progressions'=>[
            //            'asp_orb_all'=> [0=>4,60=>3,90=>4,120=>4,180=>4,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
            'style'=>'cn',
        ],
        'davison'=>[
            //            'asp_orb_all'=> [0=>6,60=>5,90=>6,120=>6,180=>6,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'marks'=>[
            //            'asp_orb_all'=> [0=>6,60=>5,90=>6,120=>6,180=>6,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'divination'=>[
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
    ];
    public $setting2 = [
        'now'=>[
            'asp_orb_all'=> [0=>4,60=>2,90=>3,120=>3,180=>3.5,30=>0.5,150=>1,45=>1,135=>1,72=>0.5,144=>0.5],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[3,2.5,1,1,1,1.5,1.5,1,1,0.5],
            'h_sys'=>'p',
        ],
        'natal'=>[
            'asp_orb_all'=> [0=>4,60=>2,90=>3,120=>3,180=>3.5,30=>0.5,150=>1,45=>1,135=>1,72=>0.5,144=>0.5],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[3,2.5,1,1,1,1.5,1.5,1,1,0.5],
            'h_sys'=>'p',
        ],
        'transits'=>[
            'asp_orb_all'=> [0=>2,60=>1,90=>2,120=>2,180=>2,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'thirdprogressed'=>[
            'asp_orb_all'=> [0=>3,60=>2,90=>3,120=>3,180=>3,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'thirdprogressedvsnatal'=>[
            'asp_orb_all'=> [0=>2,60=>1,90=>2,120=>2,180=>2,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'progressions'=>[
            'asp_orb_all'=> [0=>2,60=>2,90=>2,120=>2,180=>2,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'progressionsvsnatal'=>[
            'asp_orb_all'=> [0=>2,60=>1,90=>2,120=>2,180=>2,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'solar'=>[
            'asp_orb_all'=> [0=>1,60=>0,90=>1,120=>0,180=>1,30=>0,150=>1,45=>1,135=>1,72=>0,144=>0],
            'asps_display'=>[0,45,90,135,180],
            'planets_display'=>'111111111100100001111',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'solar_return'=>[
            'asp_orb_all'=> [0=>4,60=>2,90=>3,120=>3,180=>3.5,30=>0.5,150=>1,45=>1,135=>1,72=>0.5,144=>0.5],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[3,2.5,1,1,1,1.5,1.5,1,1,0.5],
            'h_sys'=>'p',
        ],
        'lunar_return'=>[
            'asp_orb_all'=> [0=>4,60=>2,90=>3,120=>3,180=>3.5,30=>0.5,150=>1,45=>1,135=>1,72=>0.5,144=>0.5],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100100001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'firdaria'=>[
            'asp_orb_all'=> [0=>4,60=>2,90=>3,120=>3,180=>3.5,30=>0.5,150=>1,45=>1,135=>1,72=>0.5,144=>0.5],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[3,2.5,1,1,1,1.5,1.5,1,1,0.5],
            'h_sys'=>'p',
            'firdaria'=>'default',
        ],
        'profection'=>[
            'asp_orb_all'=> [0=>4,60=>2,90=>3,120=>3,180=>3.5,30=>0.5,150=>1,45=>1,135=>1,72=>0.5,144=>0.5],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[3,2.5,1,1,1,1.5,1.5,1,1,0.5],
            'h_sys'=>'p',
        ],
        'synastry'=>[
            'asp_orb_all'=> [0=>6,60=>4,90=>6,120=>6,180=>6,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100100001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'composite'=>[
            'asp_orb_all'=> [0=>4,60=>3,90=>4,120=>4,180=>4,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'composite_thirdprogressed'=>[
            'asp_orb_all'=> [0=>5,60=>4,90=>5,120=>5,180=>5,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'composite_progressions'=>[
            'asp_orb_all'=> [0=>4,60=>3,90=>4,120=>4,180=>4,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'davison'=>[
            'asp_orb_all'=> [0=>6,60=>5,90=>6,120=>6,180=>6,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'marks'=>[
            'asp_orb_all'=> [0=>6,60=>5,90=>6,120=>6,180=>6,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'divination'=>[
            'asp_orb_all'=> [0=>4,60=>2,90=>3,120=>3,180=>3.5,30=>0.5,150=>1,45=>1,135=>1,72=>0.5,144=>0.5],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[3,2.5,1,1,1,1.5,1.5,1,1,0.5],
            'h_sys'=>'p',
        ],
    ];
    public $setting3 = [
        'now'=>[
            'asp_orb_all'=> [0=>7,60=>5,90=>6,120=>6,180=>6,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180,30,150],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'natal'=>[
            'asp_orb_all'=> [0=>7,60=>5,90=>6,120=>6,180=>6,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180,30,150],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'transits'=>[
            'asp_orb_all'=> [0=>2,60=>1,90=>2,120=>2,180=>2,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'thirdprogressed'=>[
            'asp_orb_all'=> [0=>3,60=>2,90=>3,120=>3,180=>3,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'thirdprogressedvsnatal'=>[
            'asp_orb_all'=> [0=>3,60=>2,90=>3,120=>3,180=>3,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'progressions'=>[
            'asp_orb_all'=> [0=>2,60=>2,90=>2,120=>2,180=>2,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'progressionsvsnatal'=>[
            'asp_orb_all'=> [0=>2,60=>2,90=>2,120=>2,180=>2,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'solar'=>[
            'asp_orb_all'=> [0=>1,60=>0,90=>1,120=>0,180=>1,30=>0,150=>1,45=>1,135=>1,72=>0,144=>0],
            'asps_display'=>[0,45,90,135,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'solar_return'=>[
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'lunar_return'=>[
            'asp_orb_all'=> [0=>4,60=>2,90=>3,120=>3,180=>3.5,30=>0.5,150=>1,45=>1,135=>1,72=>0.5,144=>0.5],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'firdaria'=>[
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
            'style'=>'cn',
            'firdaria'=>'default',
        ],
        'profection'=>[
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'synastry'=>[
            'asp_orb_all'=> [0=>6,60=>4,90=>6,120=>6,180=>6,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'composite'=>[
            'asp_orb_all'=> [0=>4,60=>3,90=>4,120=>4,180=>4,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'composite_thirdprogressed'=>[
            'asp_orb_all'=> [0=>5,60=>4,90=>5,120=>5,180=>5,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'composite_progressions'=>[
            'asp_orb_all'=> [0=>4,60=>3,90=>4,120=>4,180=>4,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'davison'=>[
            'asp_orb_all'=> [0=>6,60=>5,90=>6,120=>6,180=>6,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'marks'=>[
            'asp_orb_all'=> [0=>6,60=>5,90=>6,120=>6,180=>6,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'divination'=>[
            'asp_orb_all'=> [0=>7,60=>5,90=>6,120=>6,180=>6,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180,30,150],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
    ];


    /**
     * 用户配置初始化
     */
    public function init($uid = null)
    {

        $time = time();

        $exist_count = Db::table('app_astro_setting')->where(['uid'=>$uid])->count('id');
        if($exist_count >= 3)
        {
            echo json_encode(['code'=>10720,'msg'=>'It is already initialization.']);
            exit;
        }

        $setting1 = $this->setting1;
        foreach ($setting1 as $k1 => $item1)
        {
            if(in_array($k1,$this->charts)) $setting1[$k1] = json_encode($item1);
        }
        $setting1['create_time'] = $time;
//        $setting1['update_time'] = $time;
        $setting1['use_time'] = $time;
        $setting1['tid'] = 1;
        $setting1['uid'] = $uid;

        $setting2 = $this->setting2;
        foreach ($setting2 as $k2 => $item2)
        {
            if(in_array($k2,$this->charts)) $setting2[$k2] = json_encode($item2);
        }
        $setting2['create_time'] = $time;
//        $setting2['update_time'] = $time;
        $setting2['use_time'] = $time;
        $setting2['tid'] = 2;
        $setting2['uid'] = $uid;

        $setting3 = $this->setting3;
        foreach ($setting3 as $k3 => $item3)
        {
            if(in_array($k3,$this->charts)) $setting3[$k3] = json_encode($item3);
        }
        $setting3['create_time'] = $time;
//        $setting3['update_time'] = $time;
        $setting3['use_time'] = $time;
        $setting3['tid'] = 3;
        $setting3['uid'] = $uid;

        Db::table('app_astro_setting')->insertGetId($setting1);
        Db::table('app_astro_setting')->insertGetId($setting2);
        Db::table('app_astro_setting')->insertGetId($setting3);

//        Db::startTrans();
//        try{
//            Db::table('app_astro_setting')->insertGetId($setting1);
//            Db::table('app_astro_setting')->insertGetId($setting2);
//            Db::table('app_astro_setting')->insertGetId($setting3);
//            Db::commit();
//        } catch (\Exception $e) {
//            Db::rollback();
//            echo json_encode(['code'=>10721,'msg'=>'Initialization failed.']);
//            exit;
//        }
    }
}
